package com.tang.web_standard.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

/**
 * @Author tangyuan2meicloud.com
 * @DATE 2021/9/16 20:06
 * @Desc
 * @Remarks
 */
@RestController
public class HelloController {

    @RequestMapping("/hello")
    public String hello() {
        return "hello,world!";
    }

    @RequestMapping("/hello1")
    public String hello1() {
        if (true) {
            throw new RuntimeException("错误！！");
        }
        return "hello,world!";
    }

    @RequestMapping("/hello2")
    public List<String> hello2() {
        return Arrays.asList("hello", "world!");
    }
}
